﻿using System;

using System.Collections;
using System.Collections.Generic;

using System.Text;

namespace Demo1
{

    public class Quest2 : IEnumerable
    {
        Player _Owner;


        public Quest2(Player Owner)
        {
            _Owner = Owner;
        }

        public IEnumerator GetEnumerator()
        {



            if (_Owner._QuestInfo.Contains(2))
            {
                yield return new NCondition.WaitMessage("여기서 뭐하나", 2);

                yield break;
            }

            NCondition.WaitMessage msg = new NCondition.WaitMessage("반갑군. 내부탁을 들어줄수있나?", 0);

            yield return msg;

            if (msg.Ret() == "OK")
            {
                _Owner._QuestInfo.Add(2);

                yield return new NCondition.WaitMessage("그놈 꼭 잡아줘야하네 ", 2);
            }
            else
            {
                yield return new NCondition.WaitMessage("실망일세 꺼지라우!!!!!!!!!!!!!!!!!", 2);

                yield break;
            }

            yield return new NCondition.WaitClickEvent(2);

            yield return new NCondition.WaitMessage("날 잡으러 온건가?", 2);

            yield return new NCondition.WaitTime(3);

            NCondition.WaitMessage msg2 = new NCondition.WaitMessage("그놈을 죽이면 내가 더큰 보상을 주지 어떤가?", 0);

            yield return msg2;

            if (msg.Ret() == "OK")
            {
                _Owner._QuestInfo.Add(3);

                yield return new NCondition.WaitMessage("자넨 똑똑한 친구군 ", 2);
            }
            else
            {
                yield return new NCondition.WaitMessage("에잇 죽어라", 2);

            }

           

            yield break;
        }

        public bool CheckRange(int x, int y, int sx, int sy)
        {

            return true;
        }

    }
}
